#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
#define rep(i, a, b) for (int i = (a); i <= (b); i++)
#define per(i, a, b) for (int i = (a); i >= (b); i--)
#define endl '\n'
const int N = 2e5 + 5;

int n, w, h, num;
int dp[N], pre[N];
struct Node {
  int w, h, id;
  bool operator<(const Node& o) const {
    if (w != o.w)
      return w < o.w;
    else
      return h < o.h;
  }
} a[N];

void solve() {
  cin >> n >> w >> h;
  num = 0;
  rep(i, 1, n) {
    int x, y;
    cin >> x >> y;
    if (x <= w || y <= h)
      continue;
    else
      a[++num] = {x, y, i};
  }
  if (!num) {
    cout << 0 << endl;
    return;
  }
  sort(a + 1, a + num + 1);
  dp[1] = 1, pre[1] = 0;
  int ans = 1;
  rep(i, 2, num) {
    int k = 0;
    rep(j, 1, i - 1) {
      if (a[i].w > a[j].w && a[i].h > a[j].h && dp[j] > dp[k]) k = j;
    }
    pre[i] = k;
    dp[i] = dp[k] + 1;
    if (dp[i] > dp[ans]) ans = i;
  }
  vector<int> path;
  while (ans) path.push_back(a[ans].id), ans = pre[ans];
  reverse(path.begin(), path.end());
  cout << path.size() << endl;
  for (int x : path) cout << x << endl;
  return;
}
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int t;
  t = 1;
  while (t--) solve();
  return 0;
}